<template>
    <el-card shadow="never" class="aui-card--fill">
        <div>
            <import-excels @submitToParent="parentSubmit"></import-excels>
        </div>
        <div>
            <export-excels :files="dataSource"></export-excels>
        </div>
        <div>
            <file-down 
                api-url="/common/down/notice" :file-id="125"
                icon="el-icon-download2" type="primary" :title="title" :FileInfo="File"></file-down>
            <file-down api-url="/common/down/notice" :file-id="125" :FileInfo="File"></file-down>
        </div>
        <div>
            <file-upload url="/student/wenxian"></file-upload>
        </div>
        <div>
            <file-down api-url="/common/down/notice" icon="" :pre-view="true" :file-id="125" title="文件预览" :FileInfo="File"></file-down>
        </div>

    </el-card>

</template>
<script>
import ExportExcels from '@/components/ExportExcels.vue'
import ImportExcels from '@/components/ImportExcels.vue'
import FileDown from '@/components/FileDown.vue'
import FileUpload from '@/components/FileUpload.vue'
export default {
    name: 'excel',
    components: { ImportExcels, ExportExcels, FileDown, FileUpload },
    data() {
        return {
            dataSource: [],
            title: '我的文件下载组件',
            File: {
                filename: '管理员功能性需求',
                path: 'student/paper',
                suffix: 'docx'
            }
        }
    },
    methods: {
        tofile() {
            this.$router.push({ name: 'view' })
        },
        parentSubmit(data) {
            // 父组件的业务逻辑
            this.dataSource = data
            // console.log(data)
            // setTimeout(() => {
            //     console.log(this.dataSource)
            // }, 1000)
            
        },
        
        
    }
}
</script>
<style scoped>
div{
    margin-bottom: 10px;
}
</style>